package com.wanghengzhi.kata;

/**
 *
 * @author wanghengzhi
 * @since 2021/11/4 22:31
 */
public class BackStageAbstractGoods extends AbstractGoods {
    public BackStageAbstractGoods(double quality, int sellIn) {
        super("Backstage Goods", quality, sellIn);
    }

    @Override
    public void updateByDay() {
        increaseQuality();
        if (sellIn < 11) {
            increaseQuality();
        }
        if (sellIn < 6) {
            increaseQuality();
        }
        decreaseSellIn();
        if (isExpired()) {
            quality = 0;
        }
    }
}
